//
//  BaseNaviController.m
//  TheProjectName
//
//  Created by 李劲成 on 16/5/19.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "BaseNaviController.h"

@implementation BaseNaviController

- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (instancetype)initWithRootViewController:(UIViewController *)rootViewController {
    self = [super initWithRootViewController:rootViewController];
    if (self) {
       
        [self.navigationBar setShadowImage:[UIImage imageNamed:@"clear"]];
        self.navigationBar.barStyle = UIBarStyleBlack;
        self.navigationBar.tintColor = [UIColor whiteColor];
        self.navigationBar.translucent = NO;
         [self.navigationBar setBackgroundImage:[MotiveManager shareMotiveManager].backImage forBarMetrics:UIBarMetricsDefault];
        // 背景
        [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changeSkin:) name:@"changeSkin" object:nil];
       
    }
    return self;
}

- (void)changeSkin:(NSNotification *)nofi{
    
    [self.navigationBar setBackgroundImage:[MotiveManager shareMotiveManager].backImage forBarMetrics:UIBarMetricsDefault];
}

@end
